home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / jazlib.arc / JZUNQFIL.C < prev    next >
Text File  |  1988-12-18  |  803b  |  39 lines

  1.  
  2. /*
  3. ┌────────────────────────────────────────────────────────────────────────────┐
  4. │jzunqfil.c                                     │
  5. │Create a unique file and return its name and file handle.             │
  6. │wname is a string which ends in a backslash !                     │
  7. │                                         │
  8. │Synopsis:                                     │
  9. │  werr = jzunqfil(whandle,wname,wattr)                      │
  10. └────────────────────────────────────────────────────────────────────────────┘
  11. */
  12. #include <jaz.h>
  13.  
  14. jzunqfil(fhandle,fname,fattr)
  15. int fhandle;
  16. char *fname;
  17. int fattr;
  18. {
  19.   TREG wreg;
  20.  
  21.   wreg.h.ah = 0x5A;           /* get unique file name handle function */
  22.  
  23.   wreg.x.ds = getds();
  24.  
  25.   wreg.x.dx = (int) fname;
  26.  
  27.   wreg.x.cx = fattr;
  28.  
  29.   msdos(&wreg);
  30.  
  31.   if (wreg.x.flags & 1)
  32.     return(-1);
  33.   else {
  34.     fhandle = wreg.x.ax;
  35.     return(0);
  36.   }
  37. }
  38.  
  39.